using System;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using DG.Tweening.Core;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Serialization;

namespace WorkFlow.TweenGo
{
    public class RectOffsetTween : TweenGoBase<RectTransform,Vector4>
    {
        protected override Tweener CreateTween(DOGetter<Vector4> startValueGetter, DOSetter<Vector4> setter, Vector4 endValue, float duration)
        {
            return DOTween.To(startValueGetter, setter, endValue, duration);
        }

        protected override void SetValue(Vector4 value)
        {
            Target.anchoredPosition = value;
            Target.offsetMin = new Vector2(value.x, value.y);
            Target.offsetMax = new Vector2(value.z, value.w);
        }
    }
}

